import { createSlice } from '@reduxjs/toolkit'
import type { PayloadAction } from '@reduxjs/toolkit'

export interface AllDataState {
  list: []
  list1: []
}

const initialState: AllDataState = {
  list: [],
  list1: []
}

export const allDataSlice = createSlice({
  name: 'allData',
  initialState,
  reducers: {
    setList: (state, action: PayloadAction<[]>) => {
      state.list = action.payload
    },
    setList1: (state, action: PayloadAction<[]>) => {
      state.list1 = action.payload
    },
  },
})

export const { setList, setList1 } = allDataSlice.actions

export default allDataSlice.reducer